<?php

namespace app\common\service;


class HostServiceHistory extends Base 
{

    function list($serviceId, $limit)
    {
        $field = 'id,content,start_time,end_time,option_time';
        //查询服务历史数据
        $data = db('host_service_history')->field($field)
            ->where('service_id',$serviceId)
            ->order('id desc')
            ->paginate($limit)->toArray();


        $data['count'] = $data['total'];

        return $data;
    }
    /**
     * @name 添加
     * @param $addData
     * @return int|string
     * @author wx
     * @date 2019/10/24 10:38
     */
    function add($addData)
    {
        return db('host_service_history')->insert($addData);
    }

    /**
     * @name 删除
     * @param $condition
     * @return int
     * @author wx
     * @date 2019/10/24 13:45
     */
    function del($condition)
    {
        return db('host_service_history')->where($condition)->delete();
    }

}